package edu.scu.declaresys.vo;

import edu.scu.declaresys.dao.util.Column;
import edu.scu.declaresys.dao.util.FieldWalker;
import edu.scu.declaresys.dao.util.Table;


/**
 * 
 * @author: zt
 * @since : 2013-7-3
 */
@Table(code=NewsClass.T_TABLE)
public class NewsClass implements java.io.Serializable
{
	private static final long	serialVersionUID	= -4812570630838594491L;
	//
	// NewsClass items.
	//
	/**
	 * 电子公告
	 */
	public static final String BULLETIN_BOARD = "bulletin_board";
	public static final int BULLETIN_BOARD_ID = 1;
	public static final int BULLETIN_BOARD_NEWS_SIZE = 10;
	
	/**
	 * 两资新闻
	 */
	public static final String FUND_NEWS = "fund_news";
	public static final int FUND_NEWS_ID = 2;
	public static final int FUND_NEWS_SIZE = 10;

	/**
	 * 项目公示
	 */
	public static final String PROJECT_NEWS = "project_news";
	public static final int PROJECT_NEWS_ID =  3;
	public static final int PROJECT_NEWS_SIZE = 10;
	
	/**
	 * 申报流程
	 */
	public static final String DECLARE_PROCESS = "declare_process";
	public static final int DECLARE_PROCESS_ID = 4;
	public static final int DECLARE_PROCESS_SIZE = 10;
	
	//
	// table column name
	//
	public static final String	T_TABLE				= "news_class";
	public static final String	T_ID				= "id";
	public static final String	T_NAME				= "name";
	//
	// Fields
	//
	@Column(code = T_ID)
	private Integer				id;
	@Column(code = T_NAME)
	private String				name;
	
	//
	// Constructors
	//
	/** default constructor */
	public NewsClass()
	{
	}
	
	/** full constructor */
	public NewsClass(String name)
	{
		this.name = name;
	}
	//
	// Override functions.
	//
	public String toString()
	{
		return FieldWalker.makeNonstaticFields(this, FieldWalker.WITHOUT_NULL);
	}
	
	@Override
	public int hashCode()
	{
		return id.hashCode();
	}

	@Override
	public boolean equals(Object obj)
	{
		if(this == obj)
		{
			return true;
		}
		if(obj == null)
		{
			return false;
		}
		if(!(obj instanceof NewsClass))
		{
			return false;
		}
		//
		return this.id.equals(((NewsClass)obj).id);
	}
	
	
	
	//
	// Getters and Setters.
	//
	public Integer getId()
	{
		return this.id;
	}
	
	public void setId(Integer id)
	{
		this.id = id;
	}
	
	public String getName()
	{
		return this.name;
	}
	
	public void setName(String name)
	{
		this.name = name;
	}
	
}
